import 'package:flutter/material.dart';
import 'package:yp/pages/order_create/logic.dart';
// import 'package:yp/views/order_create/logic.dart';
// import 'package:yp/views/order_create/logic.dart';
import 'package:yp/widgets/select_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class SelectStatusWidget extends StatelessWidget {
  final OrderCreateLogic logic;

  const SelectStatusWidget({
    Key key,
    this.logic,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(horizontal: 20.w),
      child: Container(
        padding: EdgeInsets.symmetric(
          vertical: 32.w,
        ),
        decoration: BoxDecoration(
          border: Border(
            bottom: BorderSide(
              color: Color(0xfff0f0f0),
            ),
          ),
        ),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Container(
              width: 150.w,
              child: Text(
                "跟进状态",
                style: TextStyle(
                  color: Color(0xff666666),
                  fontSize: 28.sp,
                ),
              ),
            ),
            Container(
              margin: EdgeInsets.only(top: 30.w),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: [
                  SelectButton(
                    title: "全款支付",
                    isSelected: logic.state.statusIndex == 1,
                    onTap: () => logic.selectStatus(1),
                  ),
                  SizedBox(width: 20.w),
                  SelectButton(
                    title: "订金",
                    isSelected: logic.state.statusIndex == 2,
                    onTap: () => logic.selectStatus(2),
                  ),
                  SizedBox(width: 20.w),
                  SelectButton(
                    title: "尾款",
                    isSelected: logic.state.statusIndex == 3,
                    onTap: () => logic.selectStatus(3),
                  ),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }
}
